<template>
	<view class="page">
		<!-- 头部 -->
		<!-- #ifdef MP-WEIXIN -->
			<topVue>
				<view class="slotVue">
					<image
						src="../../../static/back.png" 
						style="width: 38rpx; height: 38rpx; left: 30rpx;" 
						class="absolute-middle"
						@click="$tools.back(1)"
					></image>
					<text class="fw600 fs32 absolute-auto">学历认证</text>
				</view>
			</topVue>
		<!-- #endif -->
		<view class="label">请上传你的学历证书</view>
		
		<view class="box margin10" @click="choose()">
			<view class="inner relative">
				<image :src="img" style="width: 100%; height: 100%;" v-if="img"></image>
				<image src="../../../static/person/up.png" style="width: 92rpx; height: 68rpx;" class="absolute-auto" v-else></image>
			</view>
		</view>
		<view class="box margin10">
			<view class="inner">
				<image src="../../../static/person/case.png" style="width: 100%; height: 100%;"></image>
			</view>
		</view>
		
		<view class="inpVue margin40">
			<view class="fw600">学历</view>
			<view class="flex-between align-center margin30" @click="show=true">
				<input type="text" placeholder="请选择你的学历" placeholder-style="color: #999; font-size: 28rpx;" v-model="education" disabled/>
				<image src="../../../static/more.png" style="width: 38rpx; height: 38rpx;"></image>
			</view>
		</view>
		
		<view class="botVue flex-center align-center">
			<view class="apply fs30 fw600" @click="applyFun()">提交审核</view>
		</view>
		
		<u-action-sheet :list="list" v-model="show" @click="handleClick"></u-action-sheet>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				img: "",
				education: "",
				show: false,
				list: [
					{text: "小学"},
					{text: "初中"},
					{text: "高中"},
					{text: "大专"},
					{text: "本科"},
					{text: "硕士研究生"},
					{text: "博士研究生"}, 
					{text: "其他"},
				],      
			}
		},
		methods: {
			choose(){
				let that = this
				uni.chooseImage({
					count: 1,
					success(res){
						console.log(res)
						that.img = res.tempFilePaths[0]
					}
				})
			},
			applyFun(){
				if(!this.img) return this.$u.toast("请上传你的学历证书")
				if(!this.education) return this.$u.toast("请选择你的学历")
			},
			handleClick(e){
				console.log(e)
				this.education = this.list[e].text
			}
		}
	}
</script>

<style lang="less" scoped>
	.label {
		color: #999999;
		padding: 50rpx 0 30rpx 30rpx;
	}
	.box {
		width: 690rpx;
		height: 408rpx;
		background: #FBFBFD;
		padding: 46rpx;
		.inner {
			width: 100%;
			height: 100%;
			background: url("../../../static/person/box.png") no-repeat;
			background-size: cover;
		}
	}
	.inpVue {
		width: 690rpx;
		border-bottom: #eee 1px solid;
		padding: 30rpx 0;
		input {
			color: #333;
			font-size: 28rpx;
			display: block;
		}
	}
	.botVue {
		width: 100%;
		height: 160rpx;
		background: #fff;
		position: fixed;
		left: 0;
		bottom: 0;
		.apply {
			width: 640rpx;
			height: 96rpx;
			background: #FC132F;
			border-radius: 48rpx;
			text-align: center;
			line-height: 96rpx;
			color: #FFFFFF;
		}
	}
</style>